package controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import pojo.Customer;
import pojo.User;
import service.UserManager;
@Controller
public class UserController {
	@Resource(name="userManager")
	private UserManager manager;
	public UserController() {
	}
	
	@RequestMapping(value="/addUser",method=RequestMethod.POST)
	public String addCustomer(User c){           
		manager.addUser(c);
		System.out.println("test....");
//		model.addAttribute("user", c);
		return "redirect:/login1.jsp";
	}

	@RequestMapping(value="/checkUser",method=RequestMethod.POST,consumes="application/json")
	public String findAllCustomers(@RequestBody User c){
		User checkUser = manager.loadUser(c.getName());
		return null;
	}
}





